package com.crt.nexus.oauth.authorization;

import com.google.common.collect.Lists;
import org.springframework.security.authentication.AbstractAuthenticationToken;

import java.util.Map;

public class OauthAuthenticationToken extends AbstractAuthenticationToken {

    private final Object principal;
    private final Object credentials;
    private final Object details;
    private final Map<String, Object> additionalParameters;

    public OauthAuthenticationToken(Object principal, Object credentials, Object details, Map<String, Object> additionalParameters) {
        super(Lists.newArrayList());
        this.principal = principal;
        this.credentials = credentials;
        this.details = details;
        this.additionalParameters = additionalParameters;
    }

    @Override
    public Object getCredentials() {
        return this.credentials;
    }

    @Override
    public Object getPrincipal() {
        return this.principal;
    }

    @Override
    public Object getDetails() {
        return this.details;
    }

    public Map<String, Object> getAdditionalParameters() {
        return this.additionalParameters;
    }

}
